﻿using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;

namespace PlanetTelex.SeoMetaTags
{
    public class Migrations : DataMigrationImpl
    {
        public int Create()
        {
            ContentDefinitionManager.AlterPartDefinition("SeoMetaTagPart", cfg => cfg.Attachable());

            ContentDefinitionManager.AlterTypeDefinition("SeoMetaTagWidget",
                cfg => cfg
                    .WithPart("SeoMetaTagPart")
                    .WithPart("WidgetPart")
                    .WithPart("CommonPart")
                    .WithSetting("Stereotype", "Widget"));

            return 1;
        }

    }
}